import { _decorator, Component, View,Canvas,UITransform, log } from 'cc';
import { windowsSize } from './constant';
const { ccclass, property } = _decorator;

import {  EventTarget } from 'cc';
const eventTarget = new EventTarget();

@ccclass('node')
export class b_g extends Component {
  
    onLoad(): void {
        eventTarget.on('foo', (arg1, arg2, arg3) => {
            console.log(arg1, arg2, arg3);  // print 1, 2, 3
        });
    }

    start() {
        // 分辨率适配
        const view =this.node.getComponent(UITransform)
    
        view.width=windowsSize.width
        
        log("view.contentSize",view.contentSize)

        let arg1 = 1, arg2 = 2, arg3 = 3;
        // At most 5 args could be emit.
        eventTarget.emit('foo', arg1, arg2, arg3);
    }

    update(deltaTime: number) {
        
    }

  
}

